import { lazy } from 'react';
import { Redirect } from 'react-router-dom';

export default [
  {
    path: '/',
    exact: true,
    render: () => {
      return <Redirect to={'/home'}></Redirect>
    }
  },
  // 首页
  {
    path: '/home',
    component: lazy(() => import("@/views/home")),
  },
  // 首页详情页
  {
    exact: true,
    path: '/detail/home/:id',
    component: lazy(() => import("@/views/home/detail"))
  },
  // 搜索界面
  {
    path: '/search',
    component: lazy(() => (import("@/components/Search/index")))
  },
  {
    path: '/sale',
    component: lazy(() => import("@/views/sale")),
    routes: [
      {
        path: '/sale/choiceness',
        component: lazy(() => import("@/components/ListView"))
      },
      {
        path: '/sale/footwear',
        component: lazy(() => import("@/components/ListView"))
      },
      {
        path: '/sale/costume',
        component: lazy(() => import("@/components/ListView"))
      },
      {
        path: '/sale/numerical',
        component: lazy(() => import("@/components/ListView"))
      },
      {
        path: '/sale/interest',
        component: lazy(() => import("@/components/ListView"))
      },
    ]
  },
  // 优惠详情页
  {
    exact: true,
    path: '/detail/sale/:id',
    component: lazy(() => import("@/views/sale/detail"))
  },
  //更多子页面礼品页
  {
    exact: true,
    path: '/more/present',
    component: lazy(() => import("@/views/more/subpage/present"))
  },
  {
    path: '/discover',
    component: lazy(() => import("@/views/discover")),
    routes: [
      {
        path: '/discover/today',
        component: lazy(() => import("@/components/ListView"))
      },
      {
        path: '/discover/basketball',
        component: lazy(() => import("@/components/ListView"))
      },
      {
        path: '/discover/video',
        component: lazy(() => import("@/components/ListView"))
      },
      {
        path: '/discover/information',
        component: lazy(() => import("@/components/ListView"))
      },
      {
        path: '/discover/trend',
        component: lazy(() => import("@/components/ListView"))
      },
    ]
  },
  {
    path: '/equip',
    component: lazy(() => import("@/views/equip"))
  },
  {
    path: '/more',
    component: lazy(() => import("@/views/more"))
  },
  {
    path: '/login',
    component: lazy(() => (import("@/views/login")))
  },
  {
    path: '*',
    component: lazy(() => (import("@/views/404Notfound")))
  },
]